package com.miyake.dsp.convolution;

import java.util.ArrayList;
import java.util.List;

import com.miyake.dsp.DspComposite;

public class ConvolutionSetting {
	private DspComposite entryPoint;
	private List<Object> settingList;
	
	public ConvolutionSetting(DspComposite c) {
		this.entryPoint = c;
		createSettingList(c);
	}

	private void createSettingList(DspComposite c) {
		settingList = new ArrayList<Object>();
		while(true) {
			settingList.add(c.getSetting());
			
			if (c.getList().size() > 0) {
				c = c.getList().get(0);
			}
			else {
				break;
			}
		}
	}

	
	public DspComposite getEntryPoint() {
		return entryPoint;
	}

	public void setEntryPoint(DspComposite entryPoint) {
		this.entryPoint = entryPoint;
	}

	public List<Object> getSettingList() {
		return settingList;
	}

	public void setSettingList(List<Object> settingList) {
		this.settingList = settingList;
	}

	public DspComposite getEndPoint() {
		DspComposite composite = entryPoint;
		while(true) {
			if (composite.getList().size() > 0) {
				composite = composite.getList().get(0);
			}
			else {
				break;
			}
		}
		return composite;
	}
}
